<?php
class LoginFormSubactionLogin_Controller {
	public function main(array $getVars, array $postVars){
		$loginFormModel = new LoginFormSubsectionLogin_Model;
		$session = new Session_Core();
		$data = $session->isLoggedIn($_SESSION['user_name']);
		$article = $loginFormModel->getArticle($getVars, $postVars);
		if($data['access_level'] >= $article['category_access_level']){
			$this->template = $article['category_templatename'];
			$view = new View_Core($this->template);
			$view->assign('article', $article);
		}
		else {
			header("Location: 500.html");
		}
	}
}